#pragma once
#include "Scene.h"
#include "Object2D.h"
#include "Image.h"
#include "ScreenText.h"
#include "SceneManager.h"
#include "RealTimeController.h"
#include "Randomizer.h"
#include <iostream>
#include "global_var.h"

// This class is created to show current stage player is at to the player before starting another stage
#define Delay 2.0f			// After pressing button, delay time before going into another scene

using namespace std;

using namespace Pulpy;

class StageInfo : public Scene
{
private:
	Object2D Background;	// Background of this scene
	
	// Stage name boxes
	Object2D GameName[5];	

	// Textures
	TextureImage TextureBackground;
	TextureImage CTG[3];
	TextureImage STD[3];
	TextureImage STM[3];
	TextureImage SW[3];
	TextureImage ER[3];

	int CurrentStage;					// Keep track which stage at currently
	int GameNameIndex[5];		// Controlling animation
	int Order[5];							// Array to store stage order
	bool StageArranged;			// To check if stage order has been arranged
	float DelayTime;					// Delay time to display stage info to the player
	bool GameEnd;						// Determine if all the mini games have benn played 

public:
	StageInfo();
	void draw();
	void update();
	void reset();
	void freeResource();
	void loadResource();
	void handleKeyboard(int key, int x, int y);
	void handleKeyboardUp(int key, int x, int y);
	void handleKeyboardSpecial(int key, int x, int y);
	void getMid(int &x, int &y);
	void handleMouseClick(int button, int state, int x, int y);
	void handleMouseMove(int x, int y);
};